package com.xbongbong.pro.statistic.help.strategy.field.method;

import com.xbongbong.pro.statistic.help.FieldAnalysisHelp;
import com.xbongbong.pro.statistic.help.strategy.field.FieldAnalysisStrategy;
import com.xbongbong.pro.statistic.pojo.FieldAnalysisPojo;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author zhouwq
 * @date 2020/9/8 10:27
 */

@Component
public class ComboFieldAnalysis implements FieldAnalysisStrategy {
    @Resource
    public FieldAnalysisHelp fieldAnalysisHelp;
    @Override
    public Map<String, String> doAnalysisField(FieldAnalysisPojo fieldAnalysisPojo) {
//        FieldAttrPojo field = fieldAnalysisPojo.getField();
//        Map<String, String> results = new HashMap<>(1 << 4);
//        List<String> values = fieldAnalysisPojo.getValues();
//        List<String> valuesResult = fieldAnalysisPojo.getValuesResult();
//        if (!Objects.equals(ComboTypeEnum.LINKFORM.getType(), field.getComboType()) && !Objects.equals(field.getComboType(), ComboTypeEnum.DATARELY.getType())) {
//            results = fieldAnalysisHelp.comboAnalysis(fieldAnalysisPojo);
//        } else {
//            for (int i = 0; i < values.size(); i++) {
//                results.put(values.get(i), valuesResult.get(i));
//            }
//        }
        return fieldAnalysisHelp.comboAnalysis(fieldAnalysisPojo);
    }
}
